package com.File_io_.io_.reader_;

import java.io.BufferedReader;
import java.io.FileReader;

/**
 * @author 宋鑫宇
 * @version 1.0
 * 演示 BufferedReader 的使用
 */
public class BufferedReader_ {
    public static void main(String[] args) throws Exception {
        String filePath = "D:\\idea_WorkSpace\\myjava\\myjava\\src\\com\\File_io_\\hello.txt";
        BufferedReader bufferedReader = new BufferedReader(new FileReader(filePath));
        String line;

        while ((line = bufferedReader.readLine()) != null) {
            System.out.println(line);
        }
        //只需关闭处理流，底层会自动关闭节点流
        bufferedReader.close();
    }
}
